function model = fernTrain(feat_train, score_train)

dim = size(feat_train, 2);

feat = [];

R = 5;

k = R * 10;

for i = 1:k
    ord{i} = randperm( dim );
    feat = [feat feat_train(:, ord{i} )];
end

fernPrm = struct('thrr',[0 1], ...
                 'S',2, ...
                 'M',dim*k/R, ...
                 'R',R, ...
                 'eta',0.05, ...
                 'reg', 0.01);
             
model.fern = BuildBoostedFerns( feat, score_train, fernPrm );
model.ord = ord;